﻿<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="IP_PROJECT.About" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <hgroup class="title">
        <h1><%: Title %>.</h1>
    </hgroup>
    <asp:Repeater ID="AboutRepeater" runat="server" DataSourceID="AboutDataSource">
         <ItemTemplate>
             <asp:LoginView id="AdminView" runat="server">
                <RoleGroups>
                    <asp:RoleGroup Roles="Admin">
                        <ContentTemplate>
                            <asp:TextBox ID="AboutEditBox" runat="server" TextMode="MultiLine" Text='<%# Eval("Value") %>'/>
                            <br />
                            <asp:Button ID="Save" runat="server" Text="Save" OnClick="Save_Click" />
                        </ContentTemplate>
                    </asp:RoleGroup>
                    <asp:RoleGroup Roles="General">
                        <ContentTemplate>
                            <p><%# Eval("Value") %></p>
                        </ContentTemplate>
                    </asp:RoleGroup>
                </RoleGroups>
                <AnonymousTemplate>
                    <p><%# Eval("Value") %></p>
                </AnonymousTemplate>  
            </asp:LoginView>
         </ItemTemplate>
    </asp:Repeater>
    <asp:SqlDataSource runat="server" ID="AboutDataSource" ConnectionString='<%$ ConnectionStrings:DefaultConnection %>' SelectCommand="SELECT [Value] FROM [Map] WHERE ([View] = @View)">
        <SelectParameters>
            <asp:Parameter DefaultValue="About" Name="View" Type="String"></asp:Parameter>
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>